//导入axios插件
import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'

Vue.use(VueAxios, axios)


//创建axios实例
const instance = axios.create({
  baseURL: 'http://toutiao.itheima.net',
  timeout: 1000
});

//封装登录接口
function getLogin(mobile, code) {
  return instance({
    url: '/v1_0/authorizations',
    method: 'post',
    data: {
      mobile,
      code
    }
  })
}

//导出接口
export {
  getLogin
}
